<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class Area extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('area',function (Blueprint $table){
            $table->increments('area_id');
            $table->string('area_name',12)->comment('地区名称');
            $table->integer('area_parent_id')->unsigned()->default(1)->unique()->comment('地区父id');
            $table->tinyInteger('area_sort')->unsigned()->default(0)->comment('排序');
            $table->tinyInteger('area_deep')->unsigned()->default(1)->comment('地区深度，从1开始');
            $table->string('area_region')->comment('大区名称');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('area');
    }
}
